<?php

//首页
Route::get('/','IndexController@index');

//图书列表展示
Route::get('books', 'BookController@index');
//图书分类列表展示
Route::get('{catid}/catid', 'BookController@bookscat');
//图书信息页
Route::get('info/{bookid}','BookController@show');
//图书搜索页
Route::get('search','BookSearchController@index');

//关于我们
Route::get('about', function () {
    return view('pages.about');
});
//捐赠
Route::get('juanzeng', function () {
    return view('pages.juanzeng');
});
//举报
Route::get('jubao', function () {
    return view('pages.jubao');
});
// 保存举报
Route::post('savejubao', 'JuBaoController@savejubao');

//注册后台管理员
Route::get('admin/register', 'AdminUserController@getRegister');
Route::post('admin/register', 'AdminUserController@postRegister');

//后台登录页面
Route::get('admin/login', 'AdminUserController@getLogin');
Route::post('admin/login', 'AdminUserController@postLogin');

//////后台登录后才可以访问的页面start
Route::group(['prefix' => 'admin', 'middleware' => 'authadmin'], function() { //认证保护
//退出
Route::get('logout', 'AdminUserController@getLogout');
//后台管理页面
Route::get('dashboard', function () {
    return view('admin.index');
});
Route::get('top', 'AdminUserController@top');
Route::get('menu', 'AdminUserController@menu');
Route::get('main', 'AdminUserController@main');
//后台图书列表
Route::get('abooklist', 'AdminBookController@index');
//后台图书搜索
Route::get('abooklist', 'AdminSearchController@index');
//后台图书列表-没有归类的
Route::get('abooklistnoclass', 'AdminBookController@noclass');
//后台图书编辑，更新
Route::get('ainfoedit/{bookid}', 'AdminBookController@edit');
Route::post('ainfoedit/{bookid}', 'AdminBookController@update');
//后台图书添加
Route::get('addbook', 'AdminBookController@create');
Route::post('addbook', 'AdminBookController@store');
//删除图书
Route::get('del/{bookid}', 'AdminBookController@destroy');
//添加图书分类
Route::get('addcat', 'AdminCategoryController@addcat');
Route::post('addcat', 'AdminCategoryController@store');
//图书分类列表
Route::get('catlist', 'AdminCategoryController@index');
//添加图书标签分类
Route::get('addtags', 'AdminTagsController@addtag');
Route::post('addtags', 'AdminTagsController@store');
//图书标签分类列表
Route::get('tagslist', 'AdminTagsController@index');

//后台会员添加的图书列表
Route::get('userabooklist', 'AdminBookTempstorageController@index');
//后台会员添加的图书信息页
Route::get('ubookinfo/{bookid}','AdminBookTempstorageController@show');
//删除会员添加的图书
Route::get('deltempbook/{bookid}', 'AdminBookTempstorageController@destroy');
//后台临时图书编辑审核
Route::get('tempinfoedit/{bookid}', 'AdminBookTempstorageController@edit');
Route::post('tempinfoedit/{bookid}', 'AdminBookTempstorageController@store');

//后台会员列表
Route::get('userslist', 'AdminBookController@userslist');
//提现列表
Route::get('tixianlist', 'AdminBookController@tixianlist');

//app首页滚动广告修改
Route::get('app_add_indexslider', 'AppcanController@app_add_indexslider'); 
//保存app首页广告的参数
Route::post('saveindexslider', 'AppcanController@saveindexslider'); 

//出版社审核列表
Route::get('chubanlist', 'hangyeController@chubanlist');
//出版社审核列表 - 审核
Route::get('chubanlist_sh/{id}', 'hangyeController@chubanlist_sh');
//出版社审核列表 - 审核
Route::get('chubanlist_ck/{id}', 'hangyeController@chubanlist_ck');
//出版社审核列表 - 删除
Route::get('chubanlist_del/{id}', 'hangyeController@chubanlist_del');
//出版社赠书活动列表
Route::get('chubanzengshulist', 'hangyeController@adminzengshulist');
//编辑出版社赠书活动
Route::get('chubaneditzengshulist/{id}', 'hangyeController@admineditzengshulist');
//保存编辑出版社赠书活动
Route::post('chubaneditzengshulist/{id}', 'hangyeController@saveadmineditzengshulist');
//出版社赠书活动列表 - 删除
Route::get('chubaneditzengshulist_del/{id}', 'hangyeController@saveadmineditzengshulist_del');
// 搜索记录列表
Route::get('searchjilu', 'AdminSearchJiluController@searchjilu');
// 删除搜索记录
Route::get('del_searchjilu/{id}', 'AdminSearchJiluController@del_searchjilu');

//输入豆瓣图书地址
Route::get('caiji_douban', 'DoubanController@getAddress');
//采集豆瓣书籍信息
Route::post('douban_api', 'DoubanController@getjson');

// 采集豆瓣图书信息QueryList
Route::get('', 'CaiJiDouBanController@CaiJiDouBan');

});
////////////admin后台登录后访问end


//用户注册
Route::get('usreg', 'UsersRegController@index');
Route::post('usreg', 'UsersRegController@store');
//用户注册成功显示页面
Route::get('regok', function () {
    return view('users.regok');
});
// 验证注册用户名字是否被注册过
Route::get('ajax/UserRegCheck', 'UsersRegController@usercheck');
// 验证注册用户信箱是否被注册过
Route::get('ajax/EmailRegCheck', 'UsersRegController@emailcheck');
// 验证注册用户手机号码是否被注册过
Route::get('ajax/MobileRegCheck', 'UsersRegController@mobilecheck');

//用户登录页面
Route::get('uslogin', function () {
    return view('users.uslogin');
});

// 扫码访问小程序-登录位置
Route::get('wx-xiaochengxu', function() {
    return view('users.wx-xiaochengxu');
});
//用户登录处理
Route::post('uslogin', 'UsersRegController@uslogin');
//用户退出登录
Route::get('uslogout', 'UsersRegController@uslogout');

//前端会员中心
Route::get('u/{uid}', 'UcenterController@index');
Route::get('u/{uid}/fellow', 'UcenterController@fellow'); //关注的会员列表
Route::get('u/{uid}/fans', 'UcenterController@fans'); //粉丝的会员列表
Route::get('u/{uid}/reviewslist', 'UcenterController@reviewslist'); //会员中心长书评列表
Route::get('u/{uid}/bags', 'UcenterController@bagslist'); //转让或出借的图书列表
// 显示书单内容
Route::get('shudaninfo/{id}', 'ShudanController@shudaninfo');
// 显示会员自己的书单列表
Route::get('u/{uid}/ushudanlist', 'ShudanController@ushudanlist');
// 显示全部书单
Route::get('shudanlist', 'ShudanController@shudanlist');
// 显示全部书评
Route::get('shupinglist', 'ShupingController@shupinglist');
// 显示全部商品
Route::get('shop', 'ShopController@shop');
// 转让图书的信息
Route::get('shopinfo/{bagid}', 'ShopController@shopinfo');
//搜索书城
Route::get('shopsearch', 'ShopController@shopsearch');

//会员认证保护,网站会员登录后才可以访问的网页
Route::group(['prefix' => '/', 'middleware' => 'authuser'], function() { 
//会员添加图书信息
Route::get('uaddbooks', 'BookController@addbooks');
Route::post('uaddbooks', 'BookController@addinfo');
Route::post('saveuaddbooks', 'BookController@saveinfo');
Route::get('saveok/{bookid}', 'BookController@showinfo');
Route::post('ajax/checkisbn', 'BookController@checkisbn');
Route::get('info/{bookid}/newbookreview', 'BookController@bookreview');
//发表图书短评论
Route::post('bookscomments','BookController@addbookscomments');
//发表图书长评论的评论
Route::post('reviewcomments','BookController@reviewcomments');
//闲置图书放入书包 提交页面
Route::get('info/{bookid}/new_offer', 'BagsController@newoffer');
//闲置图书放入书包 保存
Route::post('saveaddbags', 'BagsController@saveaddbags');
//修改书包里的图书 修改页面
Route::get('bags/{id}/edit','BagsController@editbags');
//修改书包里的图书 修改保存
Route::post('saveeditbags','BagsController@saveeditbags');
//移除书包里的图书
Route::get('bags/{id}/remove','BagsController@removebags');
//保存长书评
Route::post('savebookreview', 'BookController@savebookreview');
// 想读 评分
Route::post('savereadwant', 'BookPingfenController@savereadwant');
// 在读 评分
Route::post('savereading', 'BookPingfenController@savereading');
// 读过 评分
Route::post('saveread', 'BookPingfenController@saveread');
// 修改想读，在读，读过
Route::post('savereadedit', 'BookPingfenController@savereadedit');
// 删除评分信息
Route::get('info/{bookid}/pfremove', 'BookPingfenController@pfremove');
// 会员中心-会员资料修改
Route::get('u/{uid}/admin/profile', 'UcenterController@profile');
// 保存会员修改的资料
Route::post('u/admin/saveprofile', 'UcenterController@saveprofile');
// 会员中心-会员修改头像
Route::get('u/{uid}/admin/editface', 'UsersfaceController@editface');
// 上传会员头像的图片（原始图片）
Route::post('uploadface', 'UsersfaceController@uploadface');
// 裁切上传的会员头像图片
Route::post('cutface', 'UsersfaceController@cutface');
// 会员中心-会员密码修改
Route::get('u/{uid}/admin/chpwd', 'UcenterController@chpwd');
// 检测输入的要修改的旧密码是否正确
route::post('u/admin/ischeckchpwd', 'UcenterController@ischeckchpwd');
// 保存会员修改的新密码
route::post('u/admin/savechpwd', 'UcenterController@savechpwd');
// 关注会员
Route::get('u/fellow/{uid}', 'UcenterController@fellowuser');
// 取消关注会员
Route::get('u/unfellow/{uid}', 'UcenterController@unfellowuser');
//添加书单
Route::get('addshudan', 'ShudanController@addshudan');
Route::post('saveshudan', 'ShudanController@saveshudan');
//删除书单里的图书
Route::get('shudaninfo/{shudanid}/remove/{bookid}', 'ShudanController@remove');
//编辑书单
Route::get('shudaninfo/edit/{shudanid}', 'ShudanController@edit');
//编辑后保存书单
Route::post('shudaninfo/edit/saveeditshudan/{shudanid}', 'ShudanController@saveeditshudan');
//添加认证出版社信息页面
Route::get('hangye/renzheng_chuban','hangyeController@renzhengchuban');
//保存出版社认证资料信息
Route::post('hangye/renzheng_chuban','hangyeController@saverenzhengchuban');
//出版社认证资料保存成功后显示页面,为了防止刷新重复提交
Route::get('hangye/rzcb','hangyeController@rzcb');
//出版社/出版公司管理页面
Route::get('u/hangye/chuban_main', 'hangyeController@chuban_main'); 
//出版社/出版公司认证资料查看浏览
Route::get('u/hangye/chakan_renzhengchuban', 'hangyeController@chakan_renzhengchuban'); 
//出版社/出版公司信息查看发布页面
Route::get('u/hangye/chakan_chubaninfo', 'hangyeController@chakan_chubaninfo'); 
//出版社/出版公司信息-添加信息发布页面
Route::get('u/hangye/fabu_chubaninfo', 'hangyeController@fabu_chubaninfo'); 
//出版社/出版公司信息-保存添加的信息
Route::post('u/hangye/save_chubaninfo', 'hangyeController@save_chubaninfo');
//编辑出版社信息
Route::get('u/hangye/edit_chubaninfo', 'hangyeController@edit_chubaninfo'); 
//保存编辑的出版社信息
Route::post('u/hangye/edit_chubaninfo', 'hangyeController@saveedit_chubaninfo'); 
//出版社发布的赠书列表
Route::get('u/hangye/chuban_zengshulist', 'hangyeController@chuban_zengshulist'); 
//出版社发布赠书书籍
Route::get('u/hangye/chuban_fabuzengshu', 'hangyeController@chuban_fabuzengshu'); 
//保存出版社发布赠书活动
Route::post('u/hangye/chuban_fabuzengshu', 'hangyeController@save_fabuzengshu');
//出版社编辑赠书活动
Route::get('u/hangye/chuban_editzengshu/{id}', 'hangyeController@chuban_editzengshu'); 
//编辑保存出版社发布赠书活动
Route::post('u/hangye/chuban_editzengshu/{id}', 'hangyeController@save_editzengshu'); 

//纸条列表
Route::get('zhitiao', 'Zhitiao\ZhitiaoController@zhitiao');
//纸条交流信息
Route::get('zhitiao/{userid}', 'Zhitiao\ZhitiaoController@msgs');
//保存发送的纸条信息
Route::post('zhitiao/{userid}', 'Zhitiao\ZhitiaoController@save_msgs');
//删除对应的纸条
Route::get('zhitiao/delmsg/{id}', 'Zhitiao\ZhitiaoController@delmsg');
//删除对话的全部纸条
Route::get('zhitiao/delallmsg/{userid}', 'Zhitiao\ZhitiaoController@delallmsg');

});
//网站会员认证登录后才可以访问的网页end

//显示长评内容
Route::get('review/{id}', 'BookController@reviewshow');
//显示全部长评列表
Route::get('info/{bookid}/reviewslist', 'BookController@reviewslist');
//显示全部短评列表
Route::get('comment/{bookid}', 'BookController@commentlist');
//想读，在读，读过会员的信息
Route::get('info/{bookid}/want', 'BookPingfenController@wantinfo');
Route::get('info/{bookid}/reading', 'BookPingfenController@readinginfo');
Route::get('info/{bookid}/read', 'BookPingfenController@readinfo');

//行业合作页面
Route::get('hangye','hangyeController@index');
//显示出版社内容信息
Route::get('hangye/chubaninfo/{chuban_id}','hangyeController@chubaninfo');
//显示对应的出版社赠书列表
Route::get('hangye/chubanzengshulist/{chuban_id}','hangyeController@chubanzengshulist');
//显示赠书活动的介绍信息
Route::get('hangye/chubanzengshuinfo/{id}','hangyeController@chubanzengshuinfo');
//保存赠书活动的评论信息
Route::post('hangye/chubanzengshuinfo/{id}','hangyeController@savezsliuyan');
//出版社列表
Route::get('hangye/chubanshelist','hangyeController@chubanshelist');

//夜读书app下载页面
Route::get('ydsapp', function () {
    return view('yedushu_app.appyedushu');
});

//书摘页面登录后才可以访问的页面
Route::group(['prefix' => 'shuzhai', 'middleware' => 'mobilelogin'], function() {
    //发布书摘页面
    Route::get('pubshuzhai/{bookid}', 'Shuzhai\ShuzhaiController@pubshuzhai');
    //保存发布书摘
    Route::post('pubshuzhai', 'Shuzhai\ShuzhaiController@pubshuzhai_post');
    //发布书摘评论页面
    Route::get('pubshuzhai_pinglun/{id}', 'Shuzhai\ShuzhaiController@pubshuzhai_pinglun');
    //保存发布的书摘评论
    Route::post('pubshuzhai_pinglun', 'Shuzhai\ShuzhaiController@pubshuzhai_pinglun_post');
});
//书摘页面登录后才可以访问的页end
//书摘首页
Route::get('shuzhai/lists', 'Shuzhai\ShuzhaiController@lists');
//对应的书籍的书摘列表
Route::get('shuzhai/shuzhailist/{bookid}', 'Shuzhai\ShuzhaiController@shuzhailist');
//对应的书摘的评论
Route::get('shuzhai/shuzhaipinglun/{id}', 'Shuzhai\ShuzhaiController@shuzhaipinglun');
//书摘点赞
Route::post('shuzhai/dianzan', 'Shuzhai\ShuzhaiController@dianzan');

//帖子页面登录后才可以访问的页面
Route::group(['prefix' => 'tiezi', 'middleware' => 'mobilelogin'], function() {
    //发布帖子评论页面
    Route::get('pubtiezi_pinglun/{id}', 'Tiezi\TieziController@pubtiezi_pinglun');
    //保存发布的帖子评论
    Route::post('pubtiezi_pinglun', 'Tiezi\TieziController@pubtiezi_pinglun_post');
    //发布帖子页面
    Route::get('pubtiezi', 'Tiezi\TieziController@pubtiezi');
    //保存发布帖子
    Route::post('pubtiezi', 'Tiezi\TieziController@pubtiezi_post');
});
//帖子页面登录后才可以访问的页end
//帖子列表页面
Route::get('tiezi/lists', 'Tiezi\TieziController@lists');
//对应的帖子的评论
Route::get('tiezi/tiezipinglun/{id}', 'Tiezi\TieziController@tiezipinglun');
//帖子点赞
Route::post('tiezi/dianzan', 'Tiezi\TieziController@dianzan');

//文章页面登录后才可以访问的页面
Route::group(['prefix' => 'wenzhang', 'middleware' => 'mobilelogin'], function() {
    //发布文章页面
    Route::get('pubwenzhang', 'Wenzhang\WenzhangController@pubwenzhang');
    //wangEditor编辑器上传图片处理路径
    Route::post('wenzhang_img_upload', 'Wenzhang\WenzhangController@wenzhang_img_upload');
    //保存文章内容
    Route::post('wenzhang_save', 'Wenzhang\WenzhangController@wenzhang_save');
    //发布文章评论页面
    Route::get('pubwenzhang_pinglun/{id}', 'Wenzhang\WenzhangController@pubwenzhang_pinglun');
    //保存发布的文章评论
    Route::post('pubwenzhang_pinglun', 'Wenzhang\WenzhangController@pubwenzhang_pinglun_post');
});
//文章列表页面
Route::get('wenzhang/lists', 'Wenzhang\WenzhangController@lists');
//文章点赞
Route::post('wenzhang/dianzan', 'Wenzhang\WenzhangController@dianzan');
//对应的文章的评论
Route::get('wenzhang/wenzhangpinglun/{id}', 'Wenzhang\WenzhangController@wenzhangpinglun');
//文章页面登录后才可以访问的页end

//发现
Route::get('faxian', 'Tiezi\TieziController@lists');





